# Binary file
#BIN = sample1
BIN = sample2

# Flags
CFLAGS = -O3 -arch=sm_20 --ptxas-options=-v --use_fast_math -g
LDFLAGS = # -lcudart -lgomp
INCLUDES = -I/usr/local/cuda/sdk/C/common/inc


# Compilers
CC = nvcc
LINKER = nvcc

# Files
MAKEFILE = Makefile
C_SOURCES = $(BIN).cu
HEADERS =
C_OBJS = $(patsubst %.cu, %.o, $(C_SOURCES))

# Rules
$(BIN): $(C_OBJS) $(HEADERS) $(MAKEFILE)
	$(LINKER) -o $(BIN) $(C_OBJS) $(LDFLAGS) $(INCLUDES) $(LIBS)

$(C_OBJS): $(C_SOURCES) $(HEADERS) $(MAKEFILE)
	$(CC) -c $(C_SOURCES) $(CFLAGS) $(INCLUDES) $(PARAMETERS)

run: $(BIN)
	./$(BIN) 

clean:
	rm -f $(BIN) *.o
